/* ===========================
   BASE — variabile, reset, body, header, footer
   =========================== */

:root {
    /* Paleta MAI sobră — doar bleumarin instituțional + alb + gri */
    --mai-blue-900: #0a2540;
    --mai-blue-800: #0d3258;
    --mai-blue-700: #143d6e;
    --mai-blue-600: #1e4a7a;
    --mai-blue-500: #2a5d92;
    --mai-blue-400: #4a7ab0;
    --mai-blue-300: #c5d4e6;
    /* Neutre */
    --bg: #f5f6f8;
    --bg-soft: #eef1f5;
    --card: #ffffff;
    --text: #0a2540;
    --text-dim: #546476;
    --border: #d9dfe6;
    --shadow-sm: 0 2px 6px rgba(10, 37, 64, 0.06);
    --shadow-md: 0 8px 24px rgba(10, 37, 64, 0.1);
    --shadow-lg: 0 18px 50px rgba(10, 37, 64, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; touch-action: manipulation; }
body { overflow-x: hidden; max-width: 100vw; position: relative; }
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(1200px 600px at 80% -200px, rgba(37, 99, 235, 0.08), transparent 60%),
        radial-gradient(900px 500px at -100px 200px, rgba(74, 122, 176, 0.08), transparent 60%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 220;
    width: 100%;
}

.site-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.18s;
}

.brand:hover { transform: translateY(-1px); }

.brand-logo {
    width: 130px;
    height: auto;
    filter: drop-shadow(0 2px 6px rgba(10, 37, 64, 0.15));
    flex-shrink: 0;
}

.brand-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.brand-text {
    display: none; /* Textul e integrat în logo-ul lat conform poza 2 */
}

/* === NAV === */
.site-nav {
    display: flex;
    align-items: center;
    gap: 36px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav > li {
    position: relative;
}

.site-nav > li > a,
.site-nav > li > span.nav-toggle {
    position: relative;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.25s ease;
}

.site-nav > li > a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 100%;
    height: 2px;
    background: var(--mai-blue-600);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

.site-nav > li > a:hover,
.site-nav > li > span.nav-toggle:hover {
    color: var(--mai-blue-700);
}

.site-nav > li > a:hover::before {
    transform: scaleX(1);
    transform-origin: left center;
}

.site-nav .has-dropdown > .nav-toggle::after {
    content: '+';
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--mai-blue-600);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    margin-left: 4px;
    transition: transform 0.25s;
}

.site-nav .has-dropdown:hover > .nav-toggle::after {
    transform: rotate(45deg);
}

.nav-lectii-btn {
    background: linear-gradient(135deg, var(--mai-blue-700), var(--mai-blue-500)) !important;
    color: #fff !important;
    padding: 7px 16px !important;
    border-radius: 999px !important;
    font-weight: 700 !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    box-shadow: 0 4px 14px rgba(29,78,216,0.35) !important;
}

.nav-lectii-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 20px rgba(29,78,216,0.5) !important;
    color: #fff !important;
}

.nav-lectii-btn::before {
    display: none !important;
}

.site-nav .dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    min-width: 280px;
    list-style: none;
    margin: 0;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s;
    z-index: 60;
}

.site-nav .has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-nav .dropdown a {
    display: block;
    padding: 10px 14px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.18s, color 0.18s;
}

.site-nav .dropdown a:hover {
    background: var(--bg-soft);
    color: var(--mai-blue-700);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--mai-blue-800);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.back-btn:hover {
    background: var(--mai-blue-800);
    color: #fff;
    border-color: var(--mai-blue-800);
}

/* === BREADCRUMB === */
.breadcrumb {
    max-width: 1200px;
    margin: 14px auto 0;
    padding: 0 24px;
    font-size: 13px;
    color: var(--text-dim);
}

.breadcrumb a { color: var(--mai-blue-700); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 8px; color: #94a3b8; }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* === COMMON HEADINGS === */
.section-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--mai-blue-700);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--mai-blue-900);
    margin-bottom: 16px;
    line-height: 1.15;
}

/* === FOOTER === */
.site-footer {
    background: var(--mai-blue-900);
    color: #b8c5db;
    padding: 56px 0 32px;
    margin-top: 32px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 48px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-brand-text {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    display: none;
}

.footer-tagline {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    max-width: 320px;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 0;
}

.footer-links a {
    color: #b8c5db;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.18s;
}

.footer-links a:hover { color: #fff; }

.footer-social {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    place-items: center;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-social a svg {
    width: 18px;
    height: 18px;
}

.footer-social a:hover {
    background: var(--mai-blue-600);
    transform: translateY(-2px);
    border-color: var(--mai-blue-500);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 24px 24px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #94a3b8;
}

.footer-bottom a {
    color: #cbd5e1;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: #fff;
}

/* === ANIMAȚII GLOBALE === */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}

/* Reveal pe scroll — IntersectionObserver adaugă .is-visible */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal[data-delay="1"].is-visible { transition-delay: 0.08s; }
.reveal[data-delay="2"].is-visible { transition-delay: 0.16s; }
.reveal[data-delay="3"].is-visible { transition-delay: 0.24s; }
.reveal[data-delay="4"].is-visible { transition-delay: 0.32s; }
.reveal[data-delay="5"].is-visible { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 720px) {
    .article-page .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        will-change: auto !important;
    }

    .article-page,
    .article-page * {
        max-width: 100%;
    }

    .article-shell,
    .article-grid,
    .article-grid > article,
    .article-sidebar,
    .article-card-panel,
    .article-sidebar-card,
    .toc-card,
    .article-cta,
    .callout,
    .stats-grid,
    .stat-box,
    .article-table-wrap {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .article-card-panel,
    .article-sidebar-card,
    .toc-card,
    .article-cta {
        padding: 16px !important;
        border-radius: 16px !important;
    }

    .article-card-panel h2 {
        font-size: clamp(20px, 6vw, 24px) !important;
        line-height: 1.18 !important;
        letter-spacing: -0.3px !important;
    }

    .article-card-panel h3 {
        font-size: 17px !important;
        line-height: 1.25 !important;
    }

    .article-card-panel p,
    .article-card-panel li,
    .article-cta p,
    .article-sidebar-card p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    .article-card-panel ul,
    .article-card-panel ol {
        padding-left: 18px !important;
    }

    .callout {
        padding: 14px !important;
        border-radius: 14px !important;
    }

    .stat-box {
        padding: 14px !important;
    }

    .stat-box strong {
        font-size: 22px !important;
    }

    .article-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .article-table {
        width: max-content !important;
        min-width: 520px !important;
        max-width: none !important;
    }
}

/* Shine sweep pentru CTA-uri principale */
.home-cta-discutam {
    position: relative;
    overflow: hidden;
}

.home-cta-discutam::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: translateX(-120%) skewX(-20deg);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.home-cta-discutam:hover::before {
    transform: translateX(220%) skewX(-20deg);
}

/* Footer social icons — gradient pe hover */
.footer-social a {
    overflow: hidden;
    position: relative;
}

.footer-social a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--mai-blue-500), var(--mai-blue-700));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-social a:hover::before { opacity: 1; }
.footer-social a svg { position: relative; z-index: 1; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.footer-social a:hover svg { transform: scale(1.15) rotate(-5deg); }

.footer-links a {
    position: relative;
    display: inline-block;
    transition: color 0.2s ease, transform 0.25s ease;
}

.footer-links a:hover {
    transform: translateX(4px);
}

.back-btn svg {
    transition: transform 0.3s ease;
}

.back-btn:hover svg {
    transform: translateX(-3px);
}

/* === HAMBURGER BUTTON === */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 200;
    -webkit-tap-highlight-color: rgba(29, 78, 216, 0.2);
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--mai-blue-900);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
    transform-origin: center;
    pointer-events: none;
}

.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === MOBILE NAV OVERLAY === */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 37, 64, 0.25);
    z-index: 198;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.mobile-nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* === FLOATING WHATSAPP === */
.whatsapp-floating {
    position: fixed;
    right: 18px;
    bottom: 88px;
    bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));
    width: 52px;
    height: 52px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    box-shadow: 0 12px 28px rgba(18, 140, 126, 0.28), 0 2px 8px rgba(10, 37, 64, 0.16);
    z-index: 197;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.whatsapp-floating svg {
    width: 27px;
    height: 27px;
    fill: currentColor;
}

.whatsapp-floating:hover {
    transform: translateY(-2px);
    background: #1fc45d;
    box-shadow: 0 16px 34px rgba(18, 140, 126, 0.34), 0 3px 10px rgba(10, 37, 64, 0.18);
}

.whatsapp-floating:focus-visible {
    outline: 3px solid rgba(37, 211, 102, 0.35);
    outline-offset: 4px;
}

/* === RESPONSIVE COMMON === */
@media (max-width: 1024px) {
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
    .site-nav { gap: 16px; }
    .site-nav > li > a,
    .site-nav > li > span.nav-toggle { font-size: 13px; }
}

@media (max-width: 720px) {
    .site-header-inner { padding: 8px 12px; flex-wrap: nowrap; gap: 8px; }
    .brand-logo { width: 82px; }
    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .footer-bottom { flex-direction: column; align-items: center; text-align: center; }
    .footer-links { gap: 8px; }
    .whatsapp-floating {
        right: 14px;
        bottom: 36px;
        bottom: max(36px, calc(env(safe-area-inset-bottom) + 24px));
        width: 48px;
        height: 48px;
        display: inline-flex;
    }
    .whatsapp-floating svg {
        width: 25px;
        height: 25px;
    }

    .nav-hamburger { display: flex; }
    .mobile-nav-overlay { display: block; }

    .home-cta-discutam { display: none; }
    .back-btn { display: none; }

    .site-header-inner > nav {
        position: fixed;
        top: 0;
        right: -100vw;
        width: min(300px, 85vw);
        height: 100vh;
        height: 100dvh;
        background: #fff;
        z-index: 199;
        padding: 72px 16px 32px;
        margin: 0;
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: -4px 0 24px rgba(10, 37, 64, 0.18);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        -webkit-overflow-scrolling: touch;
    }

    .site-header-inner > nav.is-open { right: 0; }

    .site-header-inner > nav .site-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        width: 100%;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .site-header-inner > nav .site-nav > li {
        width: 100%;
        position: relative;
    }

    .site-header-inner > nav .site-nav > li > a,
    .site-header-inner > nav .site-nav > li > span.nav-toggle {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 13px 14px;
        border-radius: 10px;
        font-size: 15px;
        font-weight: 600;
        color: var(--text);
        text-decoration: none;
        cursor: pointer;
        background: transparent;
        transition: background 0.15s;
        -webkit-tap-highlight-color: rgba(29, 78, 216, 0.15);
        touch-action: manipulation;
    }

    .site-header-inner > nav .site-nav > li > a:active,
    .site-header-inner > nav .site-nav > li > span.nav-toggle:active {
        background: var(--bg-soft);
    }

    .site-header-inner > nav .site-nav > li > a::before { display: none; }

    .site-header-inner > nav .site-nav .has-dropdown > .nav-toggle::after {
        margin-left: auto;
        transition: transform 0.25s;
    }
    .site-header-inner > nav .site-nav .has-dropdown.is-open > .nav-toggle::after {
        transform: rotate(45deg);
    }
    .site-header-inner > nav .site-nav .has-dropdown:hover > .nav-toggle::after {
        transform: none;
    }
    .site-header-inner > nav .site-nav .has-dropdown.is-open:hover > .nav-toggle::after {
        transform: rotate(45deg);
    }

    .site-header-inner > nav .site-nav .dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 0 0 14px !important;
        margin: 0 !important;
        min-width: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        background: transparent !important;
        list-style: none;
        transition: max-height 0.3s ease;
    }

    .site-header-inner > nav .site-nav .has-dropdown.is-open > .dropdown {
        max-height: 600px !important;
    }

    .site-header-inner > nav .site-nav .dropdown a {
        display: block;
        padding: 10px 12px;
        font-size: 13.5px;
        font-weight: 500;
        color: var(--text);
        text-decoration: none;
        border-radius: 8px;
        white-space: normal;
        -webkit-tap-highlight-color: rgba(29, 78, 216, 0.15);
        touch-action: manipulation;
    }

    .site-header-inner > nav .site-nav .dropdown a:active { background: var(--bg-soft); }

    .nav-lectii-btn {
        background: linear-gradient(135deg, var(--mai-blue-700), var(--mai-blue-500)) !important;
        color: #fff !important;
        padding: 13px 14px !important;
        border-radius: 10px !important;
        box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25) !important;
    }
}
